import { IFeidaoAiWeappPage } from '../../../../interfaces';

const FD_EVENTS_WX_NETWORK_STATUS_CHANGE = 'fd-events-wx-network-status-change';

/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/device.html#wxonnetworkstatuschangecallback)
 */
export default function on_network_status_change(fd: IFeidaoAiWeappPage) {
	const net_status = wx.onNetworkStatusChange((res) => {
		fd.emit(FD_EVENTS_WX_NETWORK_STATUS_CHANGE, res);
	});
	return net_status;
}
